package com.qd.panda.model;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * 订单优惠记录
 *
 * @author sjk
 */
@Getter
@Setter
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@TableName("panda_product_order_preferential_log")
public class ProductOrderPreferentialLog extends Model<ProductOrderPreferentialLog> implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 主键
     */
    @TableId(value = "log_id", type = IdType.ASSIGN_ID)
    private String logId;
    /**
     * 第三方订单ID
     */
    @TableField("third_party_order_id")
    private String thirdPartyOrderId;
    /**
     * 金额
     */
    @TableField("price")
    private BigDecimal price;
    /**
     * 折扣
     */
    @TableField("customer_discount")
    private Double customerDiscount;
    /**
     * 优惠金额:这一单优惠了多少钱
     */
    @TableField("discount_amount")
    private BigDecimal discountAmount;
    /**
     * 添加时间
     */
    @TableField("add_time")
    private LocalDateTime addTime;
    /**
     * 排序
     */
    @TableField("idx")
    private Integer idx;
    /**
     * 订单ID
     */
    @TableField("order_id")
    private String orderId;
    /**
     * 优惠种类
     */
    @TableField("preferential_category")
    private String preferentialCategory;

    public void freeData() {
        this.logId = null;
        this.thirdPartyOrderId = null;
        this.price = null;
        this.customerDiscount = null;
        this.discountAmount = null;
        this.addTime = null;
        this.idx = null;
        this.orderId = null;
        this.preferentialCategory = null;
    }

}
